﻿@using System.Globalization
@model Business.DbConnect.Customer
<link href="@Url.Content("~/Content/Site.css")" rel="stylesheet" type="text/css" />
<script src="@Url.Content("~/Scripts/jquery-1.5.1.min.js")" type="text/javascript"></script>
<script src="@Url.Content("~/Scripts/modernizr-1.7.min.js")" type="text/javascript"></script>
<link href="@Url.Content("../../../../Content/datePicker/datePicker.css")" rel="stylesheet" type="text/css"/>
<script type="text/javascript" src="@Url.Content("../../../../Scripts/datePicker/jquery.datePicker.js")"></script>
<style type="text/css">
    body
    {
        background-color: white;
    }
    .display-field, .editor-field
    {
        display: inline-block;
    }
</style>
<script type="text/javascript" src="@Url.Content("../../../../Scripts/datePicker/date.js")"></script>
<script type="text/javascript">
    $(document).ready(function () {
        $('.date-pick').datePicker({ clickInput: true });
    });
</script>
<h2>
    Edit</h2>
@using (Ajax.BeginForm("Edit", "Customer", new AjaxOptions { HttpMethod = "POST" }))
{
    @Html.ValidationSummary(true)
    <fieldset>
        <legend>Customer</legend>
        @Html.HiddenFor(model => model.Id)
        <div class="editor-label">
            @Html.LabelFor(model => model.FullName)
        </div>
        <div class="editor-field">
            @Html.EditorFor(model => model.FullName)
            @Html.ValidationMessageFor(model => model.FullName)
        </div>
        <div class="editor-label">
            @Html.LabelFor(model => model.CreateDate)
        </div>
        <div class="editor-field">
            @Html.EditorFor(m => m.CreateDate)
            @Html.ValidationMessageFor(m => m.CreateDate.GetDateTimeFormats('d', new CultureInfo("vi-VN", true))[0], "Sai định dạng ngày")
        </div>
        <div class="editor-label">
            @Html.LabelFor(model => model.Comment)
        </div>
        <div class="editor-field">
            @Html.EditorFor(model => model.Comment)
            @Html.ValidationMessageFor(model => model.Comment)
        </div>
        <p>
            <input type="submit" value="Save" />
        </p>
    </fieldset>
}